package com.motus.pm.daoImpl;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import com.motus.pm.dao.MeetingTaskDao;
import com.motus.pm.vo.PmMeetingTask;
import com.motus.pm.vo.PmProjectTask;

@Repository
public class MeetingTaskDaoImpl extends BaseDaoImpl<PmMeetingTask> implements
		MeetingTaskDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<PmMeetingTask> getMeetingTasksByDeptIdAndTaskState(int deptId,
			int taskState) {
		String sql="select * from pm_meeting_task where task_state = ? and user_id in (select id from motus_emp_info where deptid=?)";
		Session session = sessionFactory.getCurrentSession();
		Query query=session.createSQLQuery(sql).addEntity(PmMeetingTask.class);
		query.setInteger(0, taskState);
		query.setInteger(1, deptId);
		return query.list();
	}
	
}
